package study.service;
import java.util.List;

public class Player {

    public Player() {
        super();
        System.out.println("player的无参构造"+this.toString());
    }
    /**
     * 简单注入
     */
    private String author;
    private String name;
    private List<Songs> songs;
        public Player(String author, String name) {
        this.author = author;
        this.name = name;
    }
    public Player(String author, String name, List<Songs> songs) {
        this.author = author;
        this.name = name;
        this.songs = songs;
        System.out.println("含有三个参数的构造方法");
    }



    public void play(){
        for (Songs song:this.songs
             ) {
            System.out.println("播放音乐。。。。。。。。。。。。。中的"+this.name+"风格"+song.getStyle()+"时长："+song.getTime());
        }

    }

}
